const mongoose = require('mongoose')

const Schema = mongoose.Schema
// ai聊天记录表
const ChatAIType = {
    userId: { type: Schema.Types.ObjectId, ref: 'user' }, // 用户id
    contents: [
        {
            role: { type: String },
            content: { type: String }
        }
    ], // 聊天记录
    model: {
        temperature: { type: Number },
        content: { type: String }
    }, // 模型
    createTime: { type: Date, default: Date.now }
}

const ChatAIModel = mongoose.model('chatAI', new Schema(ChatAIType))

module.exports = ChatAIModel